package cn.exempale.mscapplication.ui;

import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import cn.exempale.mscapplication.APP;
import cn.exempale.mscapplication.model.db.dao.ResultDAO;
import cn.exempale.mscapplication.model.db.dao.TaskDAO;
import cn.exempale.mscapplication.model.db.database.AudioDb;

public class BaseActivity extends AppCompatActivity {

    protected TaskDAO taskDAO;
    protected ExecutorService executor;
    protected ResultDAO resultDAO;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        AudioDb audioDb = AudioDb.getDatabase(APP.getContext());
        taskDAO = audioDb.taskDAO();
        executor = Executors.newSingleThreadExecutor();
        resultDAO = audioDb.resultDAO();
    }
}
